Skip to content

Fix nil Err handling and zap context encoding errors#34

Merged
spiegel-im-spiegel merged 1 commit into
masterfrom
fix/error-nil-guard-and-zap-encode-errors
May 9, 2026
Merged

Fix nil Err handling and zap context encoding errors#34
spiegel-im-spiegel merged 1 commit into
masterfrom
fix/error-nil-guard-and-zap-encode-errors

Conversation

@spiegel-im-spiegel

Copy link
Copy Markdown
Member

Summary

  • guard (*errs.Error).Error() against Err == nil to avoid panic
  • keep string formatting behavior consistent when only cause is present
  • propagate AddReflected errors in zapobject.ErrObject.MarshalLogObject instead of ignoring them
  • add regression tests for both behaviors

Validation

  • go test -shuffle on ./...
  • go test -shuffle on ./zapobject/...
  • go run golang.org/x/vuln/cmd/govulncheck@latest ./...

All passed locally.

@spiegel-im-spiegel spiegel-im-spiegel merged commit f1bba67 into master May 9, 2026
5 checks passed
@spiegel-im-spiegel spiegel-im-spiegel deleted the fix/error-nil-guard-and-zap-encode-errors branch May 9, 2026 02:24
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

None yet

Projects

None yet

Development

Successfully merging this pull request may close these issues.

1 participant